Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
es-set-tostringtag
Advanced tools
A helper to optimistically set Symbol.toStringTag, when possible.
A helper to optimistically set Symbol.toStringTag, when possible.
Most common usage:
var assert = require('assert');
var setToStringTag = require('es-set-tostringtag');
var obj = {};
assert.equal(Object.prototype.toString.call(obj), '[object Object]');
setToStringTag(obj, 'tagged!');
assert.equal(Object.prototype.toString.call(obj), '[object tagged!]');
An optional options argument can be provided as the third argument. The available options are:
force
If the force
option is set to true
, the toStringTag will be set even if it is already set.
nonConfigurable
If the nonConfigurable
option is set to true
, the toStringTag will be defined as non-configurable when possible.
Simply clone the repo, npm install
, and run npm test
v2.1.0 - 2025-01-01
ede033c
28ef164
nonConfigurable
option 3bee3f0
3c8a609
@arethetypeswrong/cli
, @ljharb/eslint-config
, @ljharb/tsconfig
, @types/get-intrinsic
, @types/tape
, auto-changelog
, tape
501a969
18af289
force
option bd446a1
@arethetypeswrong/cli
7c2c2fa
aud
with npm audit
9e372d7
get-intrinsic
7df1216
hasown
993a7d2
148ed8d
FAQs
A helper to optimistically set Symbol.toStringTag, when possible.
The npm package es-set-tostringtag receives a total of 23,313,683 weekly downloads. As such, es-set-tostringtag popularity was classified as popular.
We found that es-set-tostringtag demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.